//
//  GFXNetworkHandle.h
//  
//
//  Created by FXGuo on 16/5/24.
//  Copyright © 2016年 guoguo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>

@interface GFXNetworkHandle : AFHTTPSessionManager

+ (GFXNetworkHandle *)shareHandle;

@property(nonatomic,assign)BOOL networkError;


- (void)get:(NSString *)url params:(NSDictionary *)params success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;
- (void)post:(NSString *)url params:(NSDictionary *)params  success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;
- (void)post:(NSString *)url params:(NSDictionary *)params constructingBodyWithBlock:(void (^)(id formData))block progress:(void (^)(NSProgress *progress))progress success:(void (^)(id json))success failure:(void (^)(id json))failure;

/**
 *   监听网络状态的变化
 */
+ (void)startMonitoring;
/**
 *   取消所有正在执行的网络请求项
 */
+ (void)cancelAllNetItems;

@end
